package com.bw.module_house.adapter

import android.graphics.Color
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bw.module_house.R
import com.bw.module_house.model.HouseEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
/**
 * 智慧园区-03-房源信息V1.1-史建军-20250514
 */
class HouseAdapter :BaseQuickAdapter<HouseEntity,BaseViewHolder>(R.layout.item_house_layout) {
    override fun convert(holder: BaseViewHolder, item: HouseEntity) {
        holder.setText(R.id.tv_house_number,"${item.id}室")
        holder.getView<TextView>(R.id.tv_state).apply {
            setBackgroundColor(if (item.rented) Color.GREEN else Color.RED)
            text=if (item.rented)"出租" else "未出租"
        }
        holder.setText(R.id.tv_requestName,"企业:${item.enterpriseName}")
        holder.setText(R.id.tv_area,"面积:${item.area}")
    }


}